package top.broncho.lottery.db

import androidx.room.TypeConverter
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken

class BallsConverter {
    @TypeConverter
    fun list2String(list: List<List<String>>): String {
        return Gson().toJson(list)
    }

    @TypeConverter
    fun string2List(content: String): List<List<String>> {
        val listType = object : TypeToken<List<List<String>>>() {}.type
        return Gson().fromJson(content, listType)
    }
}